
using System;
using System.Web;
using System.Web.UI;


namespace webpman
{
	
	
	public partial class @changepwd : System.Web.UI.Page
	{
		
		//private string callpage = "";
		
		protected void Page_Load(object sender, EventArgs e)
        {
			
			// Manager for generic objects, settings, languages and skins
			General GeneralClass = new General();
			
			// Update current webpage with right settings
			Page MyPage = this;
			GeneralClass.SetEnvironment(ref MyPage);
			this.Page = MyPage;
			
			
			// Code...
			GeneralClass.DBOpen();
			((master1)this.Master).MasterGeneral = GeneralClass;
			
			
			// Verify account			
			if (txtpassword1.Value != null && 
			    txtpassword2.Value != null && 
			    Session["USER"] != null)
			{
				if ((txtpassword1.Value == txtpassword2.Value) &&
				    txtpassword1.Value.Trim() != "" &&
				    txtpassword2.Value.Trim() != "")
				{	
					string RetError = 
						GeneralClass.DBChangePassword(Session["USER"].ToString(), txtpassword1.Value);
				
					if (RetError != "")
						head_password.InnerHtml = RetError;
					else
						Response.Redirect("/default.aspx");
				}
				
			}
				
			
			lblpassword1.InnerHtml = GeneralClass.RMan.GetString("changepassword1");
			lblpassword2.InnerHtml = GeneralClass.RMan.GetString("changepassword2");
			cmdchange.Value = GeneralClass.RMan.GetString("modifybutton");
			txtpassword1.Focus();
			
			// Response.Write("<!-- " + Request.Url.PathAndQuery + " -->\n");
			// Response.Write("<!-- " + txtpassword.Value + " -->\n");
			

			
        }
	}
}
